// JavaScript Document
$(function(){
	//*********************************轮播一
	
	var num_01 = 1; //初始化
	var timer_01;
	$('ol.ol_li li').mouseover(function(){
		$(this).addClass('current').siblings().removeClass('current');
		$('ul.teb_out li').hide();
		$('ul.teb_out li').eq($(this).index()).fadeIn();
		num_01 = $(this).index()+1;
	})
		
	function autoplay_01(){
			if(num_01 == 4){
				num_01 = 0;
			}
			$('ol.ol_li li').eq(num_01).addClass('current').siblings().removeClass();
			$('ul.teb_out li').eq(num_01).fadeIn().siblings().hide();
			num_01++; 
		}
		timer_01 = setInterval(autoplay_01,8000);  
		$('#bd_cont_04 li').mouseover(function(){
			clearInterval(timer_01);
		}) .mouseout(function(){
			timer_01 = setInterval(autoplay_01,8000); 
		})

	//*********************************	

})
$(document).ready(function(){
	// Cache the Window object
	$window = $(window);      
   $('div[data-type="background"]').each(function(){
     var $bgobj = $(this); // assigning the object                    
      $(window).scroll(function() {                    
		// Scroll the background at var speed
		// the yPos is a negative value because we're scrolling it UP!								
		var yPos = -($window.scrollTop() / $bgobj.data('speed')); 
		// Put together our final background position
		var coords = '50% '+ yPos + 'px';
		// Move the background
		$bgobj.css({ backgroundPosition: coords });
}); // window scroll Ends

 });	

});



